<template>
  <view class="main">
    <template v-if="myList.length > 0">
      <view v-for="(item, index) in myList" :key="index" @click="goPage(`/pages/myPage/MyBusinessCard/MyBusinessCard?cardId=${item.userId}&pageType=other`)">
        <PeopleItem :info="item" isMyFriends />
      </view>
    </template>
    <view v-else style="width: 100%; display: flex; justify-content: center; margin-top: 15rpx">
      <u-empty mode="list"></u-empty>
    </view>
  </view>
</template>

<script setup lang="ts">
import { onMounted, ref } from "vue";
import PeopleItem from "@/components/peopleItem.vue";
import { myFriendsList } from "@/api/my";
import { goPage } from "@/utils/commonFn";
const myList = ref<myTypes.myFriendsList[]>([]);
onMounted(async () => {
  const res = await myFriendsList();
  myList.value = res.data;
});
</script>

<style lang="less" scoped>
.main {
  background: #fff;
  margin-top: 20rpx;
}
</style>
